package com.dog.basics.admin.controller.mtkj;

import com.dog.basics.bean.dto.admin.mtkj.WheelchairTreatyDto;
import com.dog.basics.common.constant.SwaggerConstants;
import com.dog.basics.common.util.R;
import com.dog.basics.service.mtkj.WheelchairTreatyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 轮椅定制协议控制
 * @author: He
 * @date: Created in 2020/10/14 11:51
 * @version: 1.0
 * @modified By:
 */
@RestController
@RequestMapping("/admin/wheelchair/treaty")
@AllArgsConstructor
@Api(value = "指令控制", tags = SwaggerConstants.PC_SWAGGER + "指令控制")
public class WheelchairTreatyController {

    private final WheelchairTreatyService wheelchairTreatyService;

    /**
     * @功能描述: 公共协议远程控制指令
     * @author He
     * @date 2020/10/14
     */
    @PostMapping("/send/instructions")
    @PreAuthorize("@pms.hasPermission('wheelchair:treaty:send:instructions')")
    @ApiOperation(value = "远程控制指令-轮椅定制", notes = "轮椅定制远程控制指令 [14-开锁测试 15-查询轮椅状态（锁状态）] 权限标识:(wheelchair:treaty:send:instructions)")
    public R<Boolean> sendWheelchairTreatyInstructions(@RequestBody WheelchairTreatyDto dto) {
        return R.ok(wheelchairTreatyService.sendWheelchairTreatyInstructions(dto));
    }


}
